//
//  CAEmitterLayer.swift
//  Documentation
//
//  Created by Toj on 3/8/24.
//
// CAEmitterLayer是一个高性能的粒子引擎，
// 被用来创建实时例子动画如：烟雾，火，雨等等这些效果
//
// https://www.jianshu.com/p/b6d3ba6b37c0
// https://www.cnblogs.com/densefog/p/5424155.html
//

public struct CAEmitterLayerEmitterShape : Hashable, Equatable, RawRepresentable, @unchecked Sendable {

    public init(rawValue: String)
}
public struct CAEmitterLayerEmitterMode : Hashable, Equatable, RawRepresentable, @unchecked Sendable {

    public init(rawValue: String)
}
public struct CAEmitterLayerRenderMode : Hashable, Equatable, RawRepresentable, @unchecked Sendable {

    public init(rawValue: String)
}

@available(iOS 5.0, *)
open class CAEmitterLayer : CALayer {

    
    /* The array of emitter cells attached to the layer. Each object must
     * have the CAEmitterCell class. */
    
    open var emitterCells: [CAEmitterCell]?

    
    /* The birth rate of each cell is multiplied by this number to give the
     * actual number of particles created every second. Default value is one.
     * Animatable. */
    
    open var birthRate: Float

    
    /* The cell lifetime range is multiplied by this value when particles are
     * created. Defaults to one. Animatable. */
    
    open var lifetime: Float

    
    /* The center of the emission shape. Defaults to (0, 0, 0). Animatable. */
    
    open var emitterPosition: CGPoint

    open var emitterZPosition: CGFloat

    
    /* The size of the emission shape. Defaults to (0, 0, 0). Animatable.
     * Depending on the `emitterShape' property some of the values may be
     * ignored. */
    
    open var emitterSize: CGSize

    open var emitterDepth: CGFloat

    
    /* A string defining the type of emission shape used. Current options are:
     * `point' (the default), `line', `rectangle', `circle', `cuboid' and
     * `sphere'. */
    
    open var emitterShape: CAEmitterLayerEmitterShape

    
    /* A string defining how particles are created relative to the emission
     * shape. Current options are `points', `outline', `surface' and
     * `volume' (the default). */
    
    open var emitterMode: CAEmitterLayerEmitterMode

    
    /* A string defining how particles are composited into the layer's
     * image. Current options are `unordered' (the default), `oldestFirst',
     * `oldestLast', `backToFront' (i.e. sorted into Z order) and
     * `additive'. The first four use source-over compositing, the last
     * uses additive compositing. */
    
    open var renderMode: CAEmitterLayerRenderMode

    
    /* When true the particles are rendered as if they directly inhabit the
     * three dimensional coordinate space of the layer's superlayer, rather
     * than being flattened into the layer's plane first. Defaults to NO.
     * If true, the effect of the `filters', `backgroundFilters' and shadow-
     * related properties of the layer is undefined. */
    
    open var preservesDepth: Bool

    
    /* Multiplies the cell-defined particle velocity. Defaults to one.
     * Animatable. */
    
    open var velocity: Float

    
    /* Multiplies the cell-defined particle scale. Defaults to one. Animatable. */
    
    open var scale: Float

    
    /* Multiplies the cell-defined particle spin. Defaults to one. Animatable. */
    
    open var spin: Float

    
    /* The seed used to initialize the random number generator. Defaults to
     * zero. Each layer has its own RNG state. For properties with a mean M
     * and a range R, random values of the properties are uniformly
     * distributed in the interval [M - R/2, M + R/2]. */
    
    open var seed: UInt32
}
extension CAEmitterLayerEmitterShape {

    
    /** `emitterShape' values. **/
    @available(iOS 5.0, *)
    public static let point: CAEmitterLayerEmitterShape

    
    @available(iOS 5.0, *)
    public static let line: CAEmitterLayerEmitterShape

    
    @available(iOS 5.0, *)
    public static let rectangle: CAEmitterLayerEmitterShape

    
    @available(iOS 5.0, *)
    public static let cuboid: CAEmitterLayerEmitterShape

    
    @available(iOS 5.0, *)
    public static let circle: CAEmitterLayerEmitterShape

    
    @available(iOS 5.0, *)
    public static let sphere: CAEmitterLayerEmitterShape
}
extension CAEmitterLayerEmitterMode {

    
    /** `emitterMode' values. **/
    @available(iOS 5.0, *)
    public static let points: CAEmitterLayerEmitterMode

    
    @available(iOS 5.0, *)
    public static let outline: CAEmitterLayerEmitterMode

    
    @available(iOS 5.0, *)
    public static let surface: CAEmitterLayerEmitterMode

    
    @available(iOS 5.0, *)
    public static let volume: CAEmitterLayerEmitterMode
}
extension CAEmitterLayerRenderMode {

    
    /** `renderMode' values. **/
    @available(iOS 5.0, *)
    public static let unordered: CAEmitterLayerRenderMode

    
    @available(iOS 5.0, *)
    public static let oldestFirst: CAEmitterLayerRenderMode

    
    @available(iOS 5.0, *)
    public static let oldestLast: CAEmitterLayerRenderMode

    
    @available(iOS 5.0, *)
    public static let backToFront: CAEmitterLayerRenderMode

    
    @available(iOS 5.0, *)
    public static let additive: CAEmitterLayerRenderMode
}
